<!-- application/views/scripts/common/layout.phtml -->
<?php echo $this->doctype(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Edit mode :: <?php echo $this->loggedTitle; ?></title>
  <?php $this->headLink()->appendStylesheet($this->websiteUrl . 'system/css/seotoaster.css'); ?>
  <?php $this->headLink()->appendStylesheet($this->websiteUrl .'system/js/thickbox/thickbox.css'); ?>  
  <?php echo $this->headLink(); ?>
  <?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/jquery/jquery.js'); ?>
  <?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/thickbox/thickbox.js'); ?>
  <?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/system.js'); ?>
  <?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/menu.js'); ?>
  <?php echo $this->headScript(); ?>
</head>
	<?php 
		if($this->isLogged) {
			switch ($this->currentUser->getRoleId()) {
				case RCMS_Object_User_User::USER_ROLE_ADMIN: ?>
				   <?php
						$langId = $_SESSION[$this->websiteUrl]['langId'];
						$translator = new RCMS_Object_Parser_LanguageParser($langId);
						$content = $translator->processScreen($this->render('frontadmin.phtml'));
						echo $content;
				   ?>
				<?php
					break;
				case RCMS_Object_User_User::USER_ROLE_USER:
					$langId = $_SESSION[$this->websiteUrl]['langId'];
					$translator = new RCMS_Object_Parser_LanguageParser($langId);
					$content = $translator->processScreen($this->render('user.phtml'));
					echo $content;
					break;
				case RCMS_Object_User_User::USER_ROLE_SUPERADMIN:
					$langId = $_SESSION[$this->websiteUrl]['langId'];
					$translator = new RCMS_Object_Parser_LanguageParser($langId);
					$content = $translator->processScreen($this->render('frontsuperadmin.phtml'));
					echo $content;
				break;
				default:

				break;
			}
		}
	?>
	<body onload="replaceNSP();statCall('<?php echo $this->statUrl;?>','<?php echo $this->statKey;?>')">
	<input type="hidden" id="hid-main-wsurl" name="hid-main-wsurl" value="<?php echo $this->websiteUrl; ?>" />
	<?php echo RCMS_Tools_Tools::stripSlashesIfQuotesOn($this->layout()->content); ?>
</body>
</html>
